money = 5000000
name = input("请输入您的姓名：")

def main_menu():
    print("--------------主菜单-------------")
    print(f"{name}，您好，欢迎来到ATM，请选择操作")
    print("查询余额\t[输入1]")
    print("存款\t\t[输入2]")
    print("取款\t\t[输入3]")
    print("退出\t\t[输入4]")
    oper = int(input("请输入您的选择："))
    return oper

def get_money(show_header):
    if show_header:
        print("--------------查询余额-------------")
    print(f"{name}，您好，您的余额剩余：{money}")

def income():
    print("--------------存款-------------")
    income_money = float(input("请输入存款金额："))
    global money
    money = money + income_money
    get_money(False)

def out():
    print("--------------取款-------------")
    out_money = float(input("请输入取款金额："))
    global money
    money = money - out_money
    get_money(False)

def exit_atm():
    print("欢迎您下次使用")
    return None

while True:
    oper = main_menu()
    if oper == 1:
        get_money(True)
        continue
    elif oper == 2:
        income()
        continue
    elif oper == 3:
        out()
        continue
    elif oper == 4:
        exit_atm()
        break
    else:
        print("未知的操作类型")